#include "StdAfx.h"
#include "Triangle.h"

CTriangle::CTriangle(void)
{
}

CTriangle::CTriangle(CPoint3D pBegin, CPoint3D pEnd)
{
	m_Begin = pBegin;
	m_End = pEnd;
}

CTriangle::~CTriangle(void)
{
}

void CTriangle::Draw()
{
	// if the object is selected, the drawing color is blue. Otherwise, it is black.
	if (selected)
		glColor3fv(blue);
	else 
		glColor3fv(black);

	//glTranslatef(0.0f ,0.75f, 0.0f);
	//glutSolidSphere(0.75f,20,20);


	


	glBegin(GL_TRIANGLES);						// Drawing Using Triangles
	glVertex2f((m_Begin.getX() + m_End.getX()) / 2, m_Begin.getY());				// Top
	glVertex2f(m_Begin.getX(), m_End.getY());				// Bottom Left
	glVertex2f( m_End.getX(), m_End.getY());				// Bottom Right
	glEnd();

	/*glBegin(GL_QUADS);
	glVertex2f(m_Begin.getX(), m_Begin.getY());
	glVertex2f(m_Begin.getX(), m_End.getY());
	glVertex2f(m_End.getX(), m_End.getY());
	glVertex2f(m_End.getX(), m_Begin.getY());
	glEnd();*/
}
